<?php
include_once("../../service/productService.php");
include_once("../../util/constant.php");

$ids = split('[,]', $_POST["ids"]);
$prices = split('[,]', $_POST["prices"]);

for($i = 0; $i < count($ids); ++$i){
    $formatedId = substr($ids[$i], 4, strlen($ids[$i]));
    updateProductPrice($formatedId, $prices[$i]);
}

echo UPDATE_SUCCESSFULLY;
?>